From: Carlos Garnacho Date: Thu, 15 Feb 2018 12:23:54 +0000 (+0100) Subject: keyboard: Avoid using key.label for anything else than presentation X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~994^2^2~31 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=9cf2ec8bd2a3552afc622823cca7599bbcaa8926;p=gnome-shell.git keyboard: Avoid using key.label for anything else than presentation Do the finicky checks to adjust key widths and whatnot based on other values than the label. This makes the label exclusively used for presentation (i.e. setting up a St.Label). https://gitlab.gnome.org/GNOME/gnome-shell/issues/46 --- diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 37e86fdb7..a830fdd05 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -849,7 +849,8 @@ var Keyboard = new Lang.Class({ } /* Fixup default keys based on the number of levels/keys */ - if (key.label == '⇧' && numLevels == 3) { + if (switchToLevel == 1 && numLevels == 3) { + // Hide shift key if the keymap has no uppercase level if (key.right) { /* Only hide the key actor, so the container still takes space */ extraButton.keyButton.hide(); @@ -859,7 +860,7 @@ var Keyboard = new Lang.Class({ extraButton.setWidth(1.5); } else if (key.right && numKeys > 8) { extraButton.setWidth(2); - } else if (key.label == '⏎' && numKeys > 9) { + } else if (keyval == Clutter.KEY_Return && numKeys > 9) { extraButton.setWidth(1.5); }